<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="robots" content="noodp" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
        <title>hugo博客搭建教程 - 断点的博客</title><meta name="Description" content="Hugo搭建博客并部署到你自己的gitee-page上（白嫖服务器，嘿嘿）"><meta property="og:title" content="hugo博客搭建教程" />
<meta property="og:description" content="Hugo搭建博客并部署到你自己的gitee-page上（白嫖服务器，嘿嘿）" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://breakpoint2333.gitee.io/breakpoint/posts/hugo-blog%E6%90%AD%E5%BB%BA/" /><meta property="article:section" content="posts" />
<meta property="article:published_time" content="2020-08-01T17:55:28&#43;08:00" />
<meta property="article:modified_time" content="2020-08-01T17:55:28&#43;08:00" />

<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="hugo博客搭建教程"/>
<meta name="twitter:description" content="Hugo搭建博客并部署到你自己的gitee-page上（白嫖服务器，嘿嘿）"/>
<meta name="application-name" content="断点的博客">
<meta name="apple-mobile-web-app-title" content="断点的博客"><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
        <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
        <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="manifest" href="/site.webmanifest"><link rel="canonical" href="https://breakpoint2333.gitee.io/breakpoint/posts/hugo-blog%E6%90%AD%E5%BB%BA/" /><link rel="prev" href="https://breakpoint2333.gitee.io/breakpoint/posts/mysql-docker%E5%AE%89%E8%A3%85/" /><link rel="stylesheet" href="/breakpoint/lib/normalize/normalize.min.css"><link rel="stylesheet" href="/breakpoint/css/style.min.css"><link rel="stylesheet" href="/breakpoint/lib/fontawesome-free/all.min.css"><link rel="stylesheet" href="/breakpoint/lib/animate/animate.min.css"><script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "headline": "hugo博客搭建教程",
        "inLanguage": "zh-CN",
        "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "https:\/\/breakpoint2333.gitee.io\/breakpoint\/posts\/hugo-blog%E6%90%AD%E5%BB%BA\/"
        },"genre": "posts","keywords": "项目搭建, Git","wordcount":  1167 ,
        "url": "https:\/\/breakpoint2333.gitee.io\/breakpoint\/posts\/hugo-blog%E6%90%AD%E5%BB%BA\/","datePublished": "2020-08-01T17:55:28+08:00","dateModified": "2020-08-01T17:55:28+08:00","publisher": {
            "@type": "Organization",
            "name": "BreakPoint2333"},"author": {
                "@type": "Person",
                "name": "BreakPoint2333"
            },"description": "Hugo搭建博客并部署到你自己的gitee-page上（白嫖服务器，嘿嘿）"
    }
    </script></head>
    <body header-desktop="" header-mobile=""><script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '' === 'dark')) && document.body.setAttribute('theme', 'dark');</script>

        <div id="mask"></div><div class="wrapper"><header class="desktop" id="header-desktop">
    <div class="header-wrapper">
        <div class="header-title">
            <a href="/breakpoint/" title="断点的博客"><span class="header-title-pre"><i class='far fa-kiss-wink-heart fa-fw'></i></span><span id="id-1" class="typeit"></span></a>
        </div>
        <div class="menu">
            <div class="menu-inner"><a class="menu-item" href="/breakpoint/posts/"> 所有文章 </a><a class="menu-item" href="/breakpoint/tags/"> 标签 </a><a class="menu-item" href="/breakpoint/categories/"> 分类 </a><a class="menu-item" href="https://github.com/COOL-BOYS-JACK-MA" title="GitHub" rel="noopener noreffer" target="_blank"><i class='fab fa-github fa-fw'></i>  </a><span class="menu-item delimiter"></span><span class="menu-item search" id="search-desktop">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-desktop">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="搜索">
                            <i class="fas fa-search fa-fw"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-desktop" title="清空">
                            <i class="fas fa-times-circle fa-fw"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-desktop">
                            <i class="fas fa-spinner fa-fw fa-spin"></i>
                        </span>
                    </span><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                    <i class="fas fa-adjust fa-fw"></i>
                </a>
            </div>
        </div>
    </div>
</header><header class="mobile" id="header-mobile">
    <div class="header-container">
        <div class="header-wrapper">
            <div class="header-title">
                <a href="/breakpoint/" title="断点的博客"><span class="header-title-pre"><i class='far fa-kiss-wink-heart fa-fw'></i></span><span id="id-2" class="typeit"></span></a>
            </div>
            <div class="menu-toggle" id="menu-toggle-mobile">
                <span></span><span></span><span></span>
            </div>
        </div>
        <div class="menu" id="menu-mobile"><div class="search-wrapper">
                    <div class="search mobile" id="search-mobile">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-mobile">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="搜索">
                            <i class="fas fa-search fa-fw"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-mobile" title="清空">
                            <i class="fas fa-times-circle fa-fw"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-mobile">
                            <i class="fas fa-spinner fa-fw fa-spin"></i>
                        </span>
                    </div>
                    <a href="javascript:void(0);" class="search-cancel" id="search-cancel-mobile">
                        取消
                    </a>
                </div><a class="menu-item" href="/breakpoint/posts/" title="">所有文章</a><a class="menu-item" href="/breakpoint/tags/" title="">标签</a><a class="menu-item" href="/breakpoint/categories/" title="">分类</a><a class="menu-item" href="https://github.com/COOL-BOYS-JACK-MA" title="GitHub" rel="noopener noreffer" target="_blank"><i class='fab fa-github fa-fw'></i></a><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                <i class="fas fa-adjust fa-fw"></i>
            </a></div>
    </div>
</header>
<div class="search-dropdown desktop">
    <div id="search-dropdown-desktop"></div>
</div>
<div class="search-dropdown mobile">
    <div id="search-dropdown-mobile"></div>
</div>
<main class="main">
                <div class="container"><div class="toc" id="toc-auto">
            <h2 class="toc-title">目录</h2>
            <div class="toc-content" id="toc-content-auto"></div>
        </div><article class="page single"><h1 class="single-title animated flipInX">hugo博客搭建教程</h1><div class="post-meta">
            <div class="post-meta-line"><span class="post-author"><a href="https://blog.csdn.net/qq_44643051" title="Author" target="_blank" rel="noopener noreffer author" class="author"><i class="fas fa-user-circle fa-fw"></i>BreakPoint2333</a></span>&nbsp;<span class="post-category">收录于 <a href="/breakpoint/categories/%E5%AE%9E%E6%88%98%E9%A1%B9%E7%9B%AE%E6%90%AD%E5%BB%BA/"><i class="far fa-folder fa-fw"></i>实战项目搭建</a></span></div>
            <div class="post-meta-line"><i class="far fa-calendar-alt fa-fw"></i>&nbsp;<time datetime="2020-08-01">2020-08-01</time>&nbsp;<i class="fas fa-pencil-alt fa-fw"></i>&nbsp;约 1167 字&nbsp;
                <i class="far fa-clock fa-fw"></i>&nbsp;预计阅读 3 分钟&nbsp;</div>
        </div><div class="details toc" id="toc-static"  kept="">
                <div class="details-summary toc-title">
                    <span>目录</span>
                    <span><i class="details-icon fas fa-angle-right"></i></span>
                </div>
                <div class="details-content toc-content" id="toc-content-static"><nav id="TableOfContents">
  <ul>
    <li><a href="#1-用前须知">1 用前须知</a></li>
    <li><a href="#2-使用">2 使用</a>
      <ul>
        <li><a href="#21-hugo配置文件configtoml">2.1 hugo配置文件config.toml</a></li>
        <li><a href="#22-写文章">2.2 写文章</a></li>
        <li><a href="#23-命令相关">2.3 命令相关</a></li>
      </ul>
    </li>
    <li><a href="#3-部署">3 部署</a>
      <ul>
        <li><a href="#31-上传文件至仓库并更新服务">3.1 上传文件至仓库并更新服务</a></li>
        <li><a href="#32-部署进阶版">3.2 部署进阶版</a></li>
      </ul>
    </li>
  </ul>
</nav></div>
            </div><div class="content" id="content"><p>Hugo搭建博客并部署到你自己的gitee-page上（白嫖服务器，嘿嘿） .</p>
<h2 id="1-用前须知">1 用前须知</h2>
<p>hugo是一款go语言开发的可快速生成静态博客网站的一个框架，优点快，简单;</p>
<p>我的博客采用的是loveit主题，博客样板下载地址（这里因为我从头到尾都是自己搞的，替你们踩啦很多坑，所以建议直接用我的，我的配置都已配好直接拿来用就行，顺便给我个start也不错）:  <a href="https://gitee.com/breakpoint2333/breakpoint">https://gitee.com/breakpoint2333/breakpoint</a></p>
<p>为啦方便一些懒癌症患者,我直接把我弄好的给你们打包出来(配置都已写好,包括hugo程序,解压后写写自己配置直接用就行) <a href="https://wws.lanzous.com/iWDyRn45ckj">https://wws.lanzous.com/iWDyRn45ckj</a> 密码:54y6</p>
<p>关于为啥不放在github-page上而是码云上，主要还是外网的问题，我这边的梯子访问gayhub是无压力的，但博客是给人看的，你想一个网址人家点啦半天进不去，那不太尴尬啦！</p>
<h2 id="2-使用">2 使用</h2>
<h3 id="21-hugo配置文件configtoml">2.1 hugo配置文件config.toml</h3>
<p>可以这么说，hugo博客的样式取决于配置文件</p>
<p>这里的话，其实解释的再详细也没啥用，你就去仔细的看一下我仓库里的配置文件（链接在上方用前须知） 每个干啥的都有注释，只要是中国人你绝对能看懂</p>
<h3 id="22-写文章">2.2 写文章</h3>
<p>文章是在这个content/posts目录下，你完全可以复制粘贴一份范文放在此目录下,之后在此基础上对配置再进行更改，这样比命令行新建是最省事的，多摸索摸索;</p>
<p><figure><a class="lightgallery" href="https://img-blog.csdnimg.cn/20210323222912621.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" title="https://img-blog.csdnimg.cn/20210323222912621.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-thumbnail="https://img-blog.csdnimg.cn/20210323222912621.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-sub-html="<h2>文章所在目录</h2>">
        <img
            class="lazyload"
            src="/breakpoint/svg/loading.min.svg"
            data-src="https://img-blog.csdnimg.cn/20210323222912621.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70"
            data-srcset="https://img-blog.csdnimg.cn/20210323222912621.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70, https://img-blog.csdnimg.cn/20210323222912621.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 1.5x, https://img-blog.csdnimg.cn/20210323222912621.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 2x"
            data-sizes="auto"
            alt="https://img-blog.csdnimg.cn/20210323222912621.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" />
    </a><figcaption class="image-caption">文章所在目录</figcaption>
    </figure></p>
<div class="details admonition note open">
        <div class="details-summary admonition-title">
            <i class="icon fas fa-pencil-alt fa-fw"></i>图片部分的处理<i class="details-icon fas fa-angle-right fa-fw"></i>
        </div>
        <div class="details-content">
            <div class="admonition-content">我没法给你们建议，只能跟你们说说我是怎么做的，我是直接qq截图后，粘贴到csdn的私人博客上，也就是将图片转成外链的形式，之后再把外链粘过来，优点是不用在手动处理图片的命名及存储相关的事，倍感省心，缺点，目前没感觉到；也许会有人问了，你都用csdn啦还搞个人博客干嘛？我只想说csdn的ui实在太丑，并且还有广告,但我两边都会同步搞的🙃
<figure><a class="lightgallery" href="https://img-blog.csdnimg.cn/20210323235146566.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" title="https://img-blog.csdnimg.cn/20210323235146566.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-thumbnail="https://img-blog.csdnimg.cn/20210323235146566.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-sub-html="<h2>图片转外链后再展示</h2>">
        <img
            class="lazyload"
            src="/breakpoint/svg/loading.min.svg"
            data-src="https://img-blog.csdnimg.cn/20210323235146566.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70"
            data-srcset="https://img-blog.csdnimg.cn/20210323235146566.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70, https://img-blog.csdnimg.cn/20210323235146566.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 1.5x, https://img-blog.csdnimg.cn/20210323235146566.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 2x"
            data-sizes="auto"
            alt="https://img-blog.csdnimg.cn/20210323235146566.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" />
    </a><figcaption class="image-caption">图片转外链后再展示</figcaption>
    </figure></div>
        </div>
    </div>
<h3 id="23-命令相关">2.3 命令相关</h3>
<p>你只用记住这个几个命令就可以啦</p>
<ol>
<li>本地启动服务</li>
</ol>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">hugo serve
</code></pre></div><ol start="2">
<li>打包</li>
</ol>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">hugo
</code></pre></div><p><figure><a class="lightgallery" href="https://img-blog.csdnimg.cn/20210323223359527.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" title="https://img-blog.csdnimg.cn/20210323223359527.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-thumbnail="https://img-blog.csdnimg.cn/20210323223359527.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-sub-html="<h2>生成的静态文件夹public</h2>">
        <img
            class="lazyload"
            src="/breakpoint/svg/loading.min.svg"
            data-src="https://img-blog.csdnimg.cn/20210323223359527.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70"
            data-srcset="https://img-blog.csdnimg.cn/20210323223359527.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70, https://img-blog.csdnimg.cn/20210323223359527.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 1.5x, https://img-blog.csdnimg.cn/20210323223359527.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 2x"
            data-sizes="auto"
            alt="https://img-blog.csdnimg.cn/20210323223359527.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" />
    </a><figcaption class="image-caption">生成的静态文件夹public</figcaption>
    </figure></p>
<h2 id="3-部署">3 部署</h2>
<h3 id="31-上传文件至仓库并更新服务">3.1 上传文件至仓库并更新服务</h3>
<ul>
<li>直接把你的所有文件git上传到仓库上</li>
</ul>
<p><figure><a class="lightgallery" href="https://img-blog.csdnimg.cn/2021032322375267.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" title="https://img-blog.csdnimg.cn/2021032322375267.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-thumbnail="https://img-blog.csdnimg.cn/2021032322375267.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-sub-html="<h2>git上传</h2>">
        <img
            class="lazyload"
            src="/breakpoint/svg/loading.min.svg"
            data-src="https://img-blog.csdnimg.cn/2021032322375267.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70"
            data-srcset="https://img-blog.csdnimg.cn/2021032322375267.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70, https://img-blog.csdnimg.cn/2021032322375267.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 1.5x, https://img-blog.csdnimg.cn/2021032322375267.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 2x"
            data-sizes="auto"
            alt="https://img-blog.csdnimg.cn/2021032322375267.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" />
    </a><figcaption class="image-caption">git上传</figcaption>
    </figure></p>
<ul>
<li>开启gitpage服务</li>
</ul>
<p><figure><a class="lightgallery" href="https://img-blog.csdnimg.cn/20210323224103749.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" title="https://img-blog.csdnimg.cn/20210323224103749.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-thumbnail="https://img-blog.csdnimg.cn/20210323224103749.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-sub-html="<h2>开启gite-page服务</h2>">
        <img
            class="lazyload"
            src="/breakpoint/svg/loading.min.svg"
            data-src="https://img-blog.csdnimg.cn/20210323224103749.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70"
            data-srcset="https://img-blog.csdnimg.cn/20210323224103749.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70, https://img-blog.csdnimg.cn/20210323224103749.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 1.5x, https://img-blog.csdnimg.cn/20210323224103749.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 2x"
            data-sizes="auto"
            alt="https://img-blog.csdnimg.cn/20210323224103749.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" />
    </a><figcaption class="image-caption">开启gite-page服务</figcaption>
    </figure></p>
<ul>
<li>设置目录为public(这里存放的是打包的静态文件)</li>
</ul>
<p><figure><a class="lightgallery" href="https://img-blog.csdnimg.cn/20210323224432350.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" title="https://img-blog.csdnimg.cn/20210323224432350.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-thumbnail="https://img-blog.csdnimg.cn/20210323224432350.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" data-sub-html="<h2>设置目录</h2>">
        <img
            class="lazyload"
            src="/breakpoint/svg/loading.min.svg"
            data-src="https://img-blog.csdnimg.cn/20210323224432350.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70"
            data-srcset="https://img-blog.csdnimg.cn/20210323224432350.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70, https://img-blog.csdnimg.cn/20210323224432350.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 1.5x, https://img-blog.csdnimg.cn/20210323224432350.png?x-oss-process=image/watermark%2ctype_ZmFuZ3poZW5naGVpdGk%2cshadow_10%2ctext_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx%2csize_16%2ccolor_FFFFFF%2ct_70 2x"
            data-sizes="auto"
            alt="https://img-blog.csdnimg.cn/20210323224432350.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NjQzMDUx,size_16,color_FFFFFF,t_70" />
    </a><figcaption class="image-caption">设置目录</figcaption>
    </figure></p>
<p>之后就大工告成啦,访问你的gite-page链接，看有惊喜吗？</p>
<h3 id="32-部署进阶版">3.2 部署进阶版</h3>
<p>因为每次新写篇文章，都要提交推送，再重新更新page服务，但这样实在是有点麻烦啦，尤其是咱程序员，这样无意义的劳动应该省去，所以我的解决方案是自己写一个批处理脚本,直接代替我们去完成这些事情!</p>
<p>脚本也很简单,就是个bat脚本(在我的仓库里有-script.bat),暂存,提交,推送，之后自动打开page网址,再自己小手点一下更新就完啦;</p>
<div class="details admonition tip open">
        <div class="details-summary admonition-title">
            <i class="icon fas fa-lightbulb fa-fw"></i>关于git注意的一点<i class="details-icon fas fa-angle-right fa-fw"></i>
        </div>
        <div class="details-content">
            <div class="admonition-content">gitee尽量使用ssh链接，这样可以免密推送，要不每次还要输密码，输多啦你也烦啦;</div>
        </div>
    </div></div><div class="post-footer" id="post-footer">
    <div class="post-info">
        <div class="post-info-line">
            <div class="post-info-mod">
                <span>更新于 2020-08-01</span>
            </div>
            <div class="post-info-license"></div>
        </div>
        <div class="post-info-line">
            <div class="post-info-md"></div>
            <div class="post-info-share">
                <span><a href="javascript:void(0);" title="分享到 Twitter" data-sharer="twitter" data-url="https://breakpoint2333.gitee.io/breakpoint/posts/hugo-blog%E6%90%AD%E5%BB%BA/" data-title="hugo博客搭建教程" data-hashtags="项目搭建,Git"><i class="fab fa-twitter fa-fw"></i></a></span>
            </div>
        </div>
    </div>

    <div class="post-info-more">
        <section class="post-tags"><i class="fas fa-tags fa-fw"></i>&nbsp;<a href="/breakpoint/tags/%E9%A1%B9%E7%9B%AE%E6%90%AD%E5%BB%BA/">项目搭建</a>,&nbsp;<a href="/breakpoint/tags/git/">Git</a></section>
        <section>
            <span><a href="javascript:void(0);" onclick="window.history.back();">返回</a></span>&nbsp;|&nbsp;<span><a href="/breakpoint/">主页</a></span>
        </section>
    </div>

    <div class="post-nav"><a href="/breakpoint/posts/mysql-docker%E5%AE%89%E8%A3%85/" class="prev" rel="prev" title="MySQL安装-docker"><i class="fas fa-angle-left fa-fw"></i>MySQL安装-docker</a></div>
</div>
</article></div>
            </main><footer class="footer">
        <div class="footer-container"><div class="footer-line">这里是断点的世界</div><div class="footer-line"><span class="author" itemprop="copyrightHolder">&nbsp;<a href="/breakpoint/" target="_blank">断点</a></span><span class="icp-splitter">&nbsp;|&nbsp;</span><br class="icp-br"/>
                    <span class="icp">豫ICP备20011333号</span></div>
        </div>
    </footer></div>

        <div id="fixed-buttons"><a href="#" id="back-to-top" class="fixed-button" title="回到顶部">
                <i class="fas fa-arrow-up fa-fw"></i>
            </a><a href="#" id="view-comments" class="fixed-button" title="查看评论">
                <i class="fas fa-comment fa-fw"></i>
            </a>
        </div><link rel="stylesheet" href="/breakpoint/lib/lightgallery/lightgallery.min.css"><script type="text/javascript" src="/breakpoint/lib/smooth-scroll/smooth-scroll.min.js"></script><script type="text/javascript" src="/breakpoint/lib/autocomplete/autocomplete.min.js"></script><script type="text/javascript" src="/breakpoint/lib/lunr/lunr.min.js"></script><script type="text/javascript" src="/breakpoint/lib/lunr/lunr.stemmer.support.min.js"></script><script type="text/javascript" src="/breakpoint/lib/lunr/lunr.zh.min.js"></script><script type="text/javascript" src="/breakpoint/lib/lazysizes/lazysizes.min.js"></script><script type="text/javascript" src="/breakpoint/lib/lightgallery/lightgallery.min.js"></script><script type="text/javascript" src="/breakpoint/lib/lightgallery/lg-thumbnail.min.js"></script><script type="text/javascript" src="/breakpoint/lib/lightgallery/lg-zoom.min.js"></script><script type="text/javascript" src="/breakpoint/lib/clipboard/clipboard.min.js"></script><script type="text/javascript" src="/breakpoint/lib/sharer/sharer.min.js"></script><script type="text/javascript" src="/breakpoint/lib/typeit/typeit.min.js"></script><script type="text/javascript">window.config={"code":{"copyTitle":"复制到剪贴板","maxShownLines":10},"comment":{},"data":{"id-1":"断点的世界","id-2":"断点的世界"},"lightGallery":{"actualSize":false,"exThumbImage":"data-thumbnail","hideBarsDelay":2000,"selector":".lightgallery","speed":400,"thumbContHeight":80,"thumbWidth":80,"thumbnail":true},"search":{"highlightTag":"em","lunrIndexURL":"/breakpoint/index.json","lunrLanguageCode":"zh","lunrSegmentitURL":"/breakpoint/lib/lunr/lunr.segmentit.js","maxResultLength":10,"noResultsFound":"没有找到结果","snippetLength":50,"type":"lunr"},"typeit":{"cursorChar":null,"cursorSpeed":null,"data":{"id-1":["id-1"],"id-2":["id-2"]},"duration":null,"speed":null}};</script><script type="text/javascript" src="/breakpoint/js/theme.min.js"></script></body>
</html>
